<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path;
%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0">
<title>云校通-教师-课程列表</title>
<jsp:include page="/WEB-INF/page/common/_header.jsp"></jsp:include>
<body ontouchstart style="background: #FFFFFF;">
	<div class="weui_tab tab-bottom">
        <div class="weui_tab_bd">
        	 <div class="weui-header bg-blue"> 
		  		<div class="weui-header-left"><a onclick="back()" href="javascript:;" class="icon icon-109 f-white">返回</a></div>
		    	<h1 class="weui-header-title">课程列表</h1>
		    </div>
		    <div class="weui_panel weui_panel_access mt0">
			    <div class="weui_panel_bd" id="courseList">
	            </div>
		    </div>
        </div>
   </div>
</body>
<jsp:include page="/WEB-INF/page/common/_footer.jsp"></jsp:include>
<script type="text/javascript">
	loadItem();
	function loadItem() {
		$.ajax({
	  		url : basePath + "/xs/kccs/course/list/query",
			type : "post",
			dataType : "json",
			data : {
				courseId: queryStringByName("xboid"),
				studentId: queryStringByName("xbsid")
			},
	    	success: function(data){
	 		 if(data.length > 0) {
	 			var html = '';
	 		 	for(var i in data) {
	 		 		var itm = data[i];
	 				html += '<a href="<%=basePath%>/xs/kccs/course/detail/'+itm.id+window.location.search+'" class="weui_media_box weui_media_appmsg">\
				                    <div class="weui_media_hd weui_media_hd80">\
			                    <img class="weui_media_appmsg_thumb weui_media_img80" src="'+(emptyToNull(itm.mainImg) == null ? "<%=basePath%>/images/xqkt_default.png" : imgUrl + itm.mainImg)+'">\
			                </div>\
			                <div class="weui_media_bd">\
			                    <h4 class="weui_media_title">'+itm.courseName +'</h4>\
			                    '+(itm.limitNum != null ? "<p class=\"weui_media_desc f15\">已报/限制人数："+itm.studentSignCount+"/"+itm.limitNum+"</p>" : "")+'\
			                    <p class="weui_media_desc web-line-clamp3 pt5">'+(itm.courseDesc == null ? "<br/><br/><br/>" : itm.courseDesc)+'</p>\
			                </div></a>';
	 		 	}
	 		 	$("#courseList").html(html);
	         }
	      },
	      error: function(xhr, type){
	      }
	  });
	}
</script>
</html>